/**
 * 您的公司.com
 * Copyright (c) 2018-2018 All Rights Reserved.
 */
package com.mei.demo.Thread;

/**
 * 实现 Runnable 实现多线程
 *
 * @author mei.xiaoliang@qq.com
 */
public class Demo4 {

    public static void main(String[] args) {
        Thread t1 = new Thread(new thread4());
        Thread t2 = new Thread(new thread4());
        Thread t3 = new Thread(new thread4());
        t1.start();
        t2.start();
        t3.start();
    }
}

class thread4 implements Runnable {

    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            System.out.println(Thread.currentThread().getName() + " " + i + "\n");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                System.out.println("有毛病");
            }
        }
    }

}